<%--
  Created by IntelliJ IDEA.
  User: lph
  Date: 2019/10/18
  Time: 13:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>表格作业</title>
  </head>
  <body>
  <table id="mytable" border="1">
      <tr>
        <th>主题</th>
        <th>内容</th>
        <th>时间</th>
      </tr>
  </table>
  <script src="js/jquery-1.11.0.min.js"></script>
  <script>
    $(function () {
      function get_Notices() {
        $.ajax({
          type:"get",
          url:"http://localhost:9527/classwork_Web_exploded/selectNotice",
          success:function (res) {
            console.log(res.code)
            if(res.code==1) {
              var list = res.data;
              list.forEach(function (obj, index) {
                var tr = $("<tr></tr>");
                var td1 = $("<td>"+obj.title+"</td>");
                var td2 = $("<td>"+obj.content+"</td>");
                var td3 = $("<td>"+obj.time+"</td>");
                tr.append(td1).append(td2).append(td3).appendTo("#mytable");
              });
            }else{
              alert(res.massage);
            }
          },fail:function (res) {
            alert("系统异常")
          }
        })
      }
    })
  </script>
  </body>
</html>
